package com.yc.hotel.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.yc.hotel.dto.RoomInfoDTO;
import com.yc.hotel.enums.ResultEnum;
import com.yc.hotel.room.feign.IRoomInfoFeignClient;

import com.yc.hotel.vo.ResultVO;

@RestController
@RequestMapping("/room")
public class RoomInfoFeignController {

	@Autowired
	private IRoomInfoFeignClient roomInfoFeignClient;
	

	@PostMapping("/findByRno")
	private ResultVO findByRno(String rno) {
		if(rno != null) {
			RoomInfoDTO room = roomInfoFeignClient.findByRno(Integer.parseInt(rno));
			return new ResultVO(ResultEnum.SUCCESS, room);
		}
		return new ResultVO(ResultEnum.ERROR);
		
		
		
	};

}
